package com.nativetalk.dao;

import com.nativetalk.base.Page;
import com.nativetalk.bean.message.system.TdNtSystemMessage;
import com.nativetalk.bean.message.system.TdNtSystemMessageMarker;
import org.apache.ibatis.annotations.Param;

import java.sql.Timestamp;
import java.util.List;

/**
 * Created by lizhun on 16/8/27.
 */
@MyBatisRepository
public interface TdNtSystemMessageDao {
    /**
     * @Purpose  查找系统消息
     * @version  3.2
     * @author   lizhun
     * @param    page
     * @return   int
     */
    public int findSystemMessageSize(Page page);
    /**
     * @Purpose  查找时间段系统消息
     * @version  3.2
     * @author   lizhun
     * @param    page
     * @return  int
     */
    public int findSystemMessageSizeByTime(@Param("pojo") Page page, @Param("lastReadTime") Timestamp lastReadTime);
    /**
     * @Purpose  查找系统消息
     * @version  3.2
     * @author   lizhun
     * @param    page
     * @return   List<TdNtSystemMessage>
     */
    public List<com.nativetalk.bean.message.system.TdNtSystemMessage> findSystemMessage(Page page);
    /**
     * @Purpose  查找用户最后阅读时间
     * @version  3.2
     * @author   lizhun
     * @param    page
     * @return   TdNtSystemMessageMarker
     */
    public TdNtSystemMessageMarker findTdNtSystemMessageMarker(Page page);
    /**
     * @Purpose  更新用户最后阅读时间
     * @version  3.2
     * @author   lizhun
     * @param    tdNtSystemMessageMarker
     * @return   void
     */
    public void updateSystemMessageMarker(TdNtSystemMessageMarker tdNtSystemMessageMarker);
    /**
     * @Purpose  添加用户阅读时间
     * @version  3.2
     * @author   lizhun
     * @param    tdNtSystemMessageMarker
     * @return   void
     */
    public void insertSystemMessageMarker(TdNtSystemMessageMarker tdNtSystemMessageMarker);

    void insert(com.nativetalk.bean.TdNtSystemMessage msg);

    /**
     * 查询评估报告是否已存在
     * @param user_id
     * @return
     */
    public com.nativetalk.bean.TdNtSystemMessage findUserMessageSize(@Param("user_id")Integer user_id);

    /**
     * 更新评估报告发布时间
     * @param pojo
     */
    public void updateUserMessageDate(@Param("pojo") com.nativetalk.bean.TdNtSystemMessage pojo);
}
